

const CryptoJS = require("crypto-js");
const key = CryptoJS.enc.Base64.parse("storemusic");
const iv = CryptoJS.enc.Base64.parse("storemusicIv");
// 本地存储   文本加密与解密
export function setStorage(value) {
    const cipher = CryptoJS.AES.encrypt(value, key, {
        iv,
        mode: CryptoJS.mode.CFB,
        padding: CryptoJS.pad.AnsiX923,
    });
    const cipher1 = cipher.toString();
    return cipher1
}
export function getStorage(value) {
    const cipher = CryptoJS.AES.decrypt(value, key, {
        iv,
        mode: CryptoJS.mode.CFB,
        padding: CryptoJS.pad.AnsiX923,
    });
    const decryption = cipher.toString(CryptoJS.enc.Utf8);
    return decryption
}